#@form()
#define main()
        
<script type="text/javascript">
$(function(){
	
	$("#configForm").validate({
		submitHandler:function(form){
			
			$(form).ajaxSubmit({
				success: function(ret) {
					// 业务层验证成功
					if(ret.state == "ok") {
						top.msgbox(ret.msg, "ok");
						closeIframe();
					}
					
					// 业务层验证失败
					if (ret.state == "fail") {
						msgbox(ret.msg, "fail");
						return ;
					}
				}
			});
			
		}		
	});
	
})

</script>

<form class="m-t" id="configForm" method="post" action="#(ctx)/sysconfig/update">
	<div class="form-group">
		<label class="col-sm-2 control-label">KEY</label>
		<div class="col-sm-9">
			<input type="text" class="form-control required" name="key" value="#(config.key??)">
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label">VALUE</label>
		<div class="col-sm-9">
			<input type="text" class="form-control" name="value" value="#(config.value??)">
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-2 control-label">描述</label>
		<div class="col-sm-9">
			<input type="text" class="form-control required" name="description" value="#(config.description??)">
		</div>
	</div>

	<div class="form-group" style="text-align: center;">
		<input type="hidden" name="id" value="#(config.id??)">
		
		<button class="btn btn-white btn-bitbucket" type="submit">
			<i class="fa fa-plus"></i>&nbsp;保存
		</button>
		&nbsp;&nbsp;
		<button class="btn btn-white btn-bitbucket" type="button" onclick="closeIframe();">
			<i class="fa fa-warning"></i> <span class="bold">关闭</span>
		</button>
	</div>

</from>
#end


